package io.bluerain.ldrawersample;

import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by foredawn on 15-9-22.
 * 内容
 */
public class ItemFragment extends Fragment {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        LinearLayout root = new LinearLayout(getActivity());
        TextView text = new TextView(getActivity());
        String menuText = MainActivity.featureMenus[getArguments().getInt("position")].getText();
        text.setText("您选择了:" + menuText);
        //修改子级标题:
        ((AppCompatActivity) getActivity()).getSupportActionBar().setSubtitle(menuText);
        root.addView(text);
        return root;
    }
}
